﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WAD.WEB.AppCode
{
    /// <summary>
    /// 开放平台接口基础类 V1.0
    /// </summary>
    public class OpenAjaxBase : AjaxBase
    {
        string sign = "";
        string token = "";
        string time = "";
        string key1, key2, key3, key4, key5;
        
        protected override void PageLoad()
        {
            base.PageLoad();
            sign = Parse.String("sign", "");
            token = Parse.String("token", "");
            time = Parse.String("time", "");
            key1 = Parse.String("key1", "");
            key2 = Parse.String("key2", "");
            key3 = Parse.String("key3", "");
            key4 = Parse.String("key4", "");
            key5 = Parse.String("key5", "");
        }
        protected bool CheckSign()
        {
            if (string.IsNullOrEmpty(sign))
                JsonResult(17, "签名不能空");

            string s = QD.WX.Utill.Util.MD5str(key1 + key2 + key3 + key4 + key5 + time);
            if (sign.Equals(s))
                return true;
            else
                JsonResult(17, "签名不能空");

            return false;
        }

        protected bool CheckToken()
        {
            return false;
        }
    }
}